﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>studentInfo</title>
<style type="text/css">
	tr {border-color:#ccc}
    td {border-color:#ccc}
  	table {color:#08478A; font-size:14px; border-color:#ccc;}
</style>  
<script type="text/javascript">
	var mainform;
	$(document).ready(function () 
	{
		mainform = $("#mainform");
		mainform.ligerForm();
		$.metadata.setType("attr", "validate");
        LG.validate(mainform);
       
        $.validator.addMethod('sexChecker', function(value) {
        	if (value != -1)
    			return true;
    		else  
    			return false;
            }, '请选择性别'); 
		
		$(".l-toolbar-item").hover(function() {
			$(this).addClass("l-panel-btn-over");
		}, function() {
			$(this).removeClass("l-panel-btn-over");
		});

		$(".l-toolbar-item").click(function() {
			toolbarBtnItemClick($(this));
		});
		
		 // 给性别赋值
        var tSex="${command.stuSex}";        
        if(tSex=='0'){
        	$("#stuSex").val(0);
        }else{
        	$("#stuSex").val(1);
        }
	});
	
	function toolbarBtnItemClick(item) {
		switch (item.attr("toolbarid")) {
		case "modifyInfo":
			LG.submitForm(mainform, function (result) {
	        	if(typeof(result)=="string"){
	        		result=eval("("+result+")");
	        	}
	            if (!result.success) {
	                LG.showError('错误:' + data.message);
	            }
	            else { 
	                LG.showSuccess('保存成功', function () { 
	                   LG.callParent("clsList");
	                });
	            }
	        });
			break;
		case "modifyPwd":
	      	dialog=$.ligerDialog.open({url: '${ctx}/qso/student/changepwd?stuUserId=${command.stuUserId}',height:250, width:600, showMax: true, showToggle: true, showMin: true, isResize: true, modal: true, title:"修改密码"});
			break;
		}
	}
</script>
</head>
<body style="padding: 0px; overflow: hidden;">
			    <div style=" width:100%" id="mainsearch">
    				<div class="searchbox" style="padding:10px 10px 10px 10px;">
    				
<form name="mainform" method="post" id="mainform" action="${ctx }/qso/student/save">
	<input type="hidden" name="viewType" value="modify" />
	<input type="hidden" name="stuUserId" value="${command.stuUserId}" />
	<input type="hidden" name="clsId" value="${command.clsId}" />
	<input type="hidden" name="dateExpire" value="${command.dateExpire}" />
	<table border="1" class="l-table-edit" style="width: 60%; padding:15px;">
		<tr>
			<td align="right" class="l-table-edit-td" style="width: 15%;border-right:none;">学生编号:</td>
			<td align="left" class="l-table-edit-td" style="width: 35%;border-left:none;" colspan="3">
				${command.stuId} <input name="stuId" type="hidden" id="stuId"
				value="${command.stuId}" ltype="text" />
			</td>
		</tr>
		<tr>
			<td align="right" class="l-table-edit-td" style="border-right:none;">班级:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;">
			${cls.clsTitle}
			<td align="right" class="l-table-edit-td" style="border-right:none;">院系:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;">
			${cls.dept.title}
		</tr>
		<tr>
			<td align="right" class="l-table-edit-td" style="width: 15%;border-right:none;"">学生姓名:</td>
			<td align="left" class="l-table-edit-td" style="width: 35%;border-left:none;">
				<input name="stuName" type="text" id="stuName" maxlength="50" value="${command.stuName}" ltype="text" validate="{required:true, notnull:true}" nullText="不能为空" />
			</td>
			<td align="right" class="l-table-edit-td" style="border-right:none;">学生性别:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;">
			<select id="stuSex" name="stuSex" validate="{required:true, sexChecker:true}">
					<option value="-1">请选择</option>
					<option value="0">男</option>
					<option value="1">女</option>
			</select></td>	
		</tr>
		<tr>
			<td align="right" class="l-table-edit-td" style="border-right:none;">学生电话:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;">
				<input name="stuTel" type="text" id="stuTel" maxlength="15" value="${command.stuTel}" validate="{required:true, notnull:true, digits:true}" nullText="不能为空" />
			</td>
			<td align="right" class="l-table-edit-td" style="border-right:none;">学生邮箱:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;"><input name="stuMail"
				type="text" id="stuMail" value="${command.stuMail}"
				validate="{required:true, notnull:true, email:true}" nullText="不能为空" />
			</td>			
		</tr>
		<tr>
			<td align="right" class="l-table-edit-td" style="border-right:none;">虚机IP:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;">
			${vmuser.vm.ip}
			</td>
			<td align="right" class="l-table-edit-td" style="border-right:none;">备注:</td>
			<td align="left" class="l-table-edit-td" style="border-left:none;">
			${command.remark}
			</td>
		</tr>
		
		<tr>
				<td colspan="3" style="border-right:none;"></td>
				<td style="border-left:none;">
					<div class="l-toolbar-item l-panel-btn l-toolbar-item-hasicon"
						toolbarid="modifyInfo">
						<span>修改信息</span>
						<div class="l-panel-btn-l"></div>
						<div class="l-panel-btn-r"></div>
						<img src="${ctx}/static/icons/silkicons/application_edit.png">
					</div>
					<div class="l-toolbar-item l-panel-btn l-toolbar-item-hasicon"
						toolbarid="modifyPwd">
						<span>修改密码</span>
						<div class="l-panel-btn-l"></div>
						<div class="l-panel-btn-r"></div>
						<img src="${ctx}/static/icons/silkicons/application_edit.png">
					</div>
				</td>
			</tr>
	</table>
</form>    				
    				
        				<div class="l-clear"></div>
    				</div>
			    </div>


</body>
</html>
